<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWechatQrcodeTable extends Migration
{
    /**
     * 参数二维码回调函数
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat-qrcode', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->string('className')->nullable();
            $table->string('method');
            $table->string('param')->nullable();
            $table->integer('expire')->default(-1)->comment('过期时间');
            $table->string('url')->nullable()->comment('二维码URL');
            $table->string('img')->nullable()->comment('二维码图片URL');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('wechat-qrcode');
    }
}
